package com.ssy.lingxi.purchase.service.bidding;

import com.rabbitmq.client.Channel;
import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.purchase.api.dto.request.*;
import com.ssy.lingxi.purchase.api.dto.request.bidding.*;
import com.ssy.lingxi.purchase.api.dto.request.online.DiscardRequest;
import com.ssy.lingxi.purchase.api.dto.request.purchase.PurchaseListRequest;
import com.ssy.lingxi.purchase.api.dto.response.BiddingExternalWorkStateEnumResponse;
import com.ssy.lingxi.purchase.api.dto.response.bidding.*;
import com.ssy.lingxi.purchase.api.dto.response.online.OnlineBiddingListResponse;
import com.ssy.lingxi.purchase.api.dto.response.online.OnlineProductResponse;
import com.ssy.lingxi.purchase.api.dto.response.purchase.PurchaseListResponse;
import com.ssy.lingxi.purchase.api.dto.response.purchase.SearchReSourceListResponse;
import com.ssy.lingxi.purchase.config.rabbitmq.OrderRbbitMqRequest;
import com.ssy.lingxi.purchase.entity.onlinebidding.OnLineBiddingProduct;
import org.modelmapper.ModelMapper;
import org.springframework.amqp.core.Message;

import java.io.IOException;
import java.util.List;

/**
 * 采购竞价
 *
 * @author wrc
 * @date 2021/3/23
 */
public interface BiddingService {

    /**
     * 采购竞价单查询
     */
    Wrapper<PageData<BiddingListResponse>> biddingList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-采购竞价单详情
     */
    Wrapper<BiddingDetailsResponse> biddingDetails(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购物料分页查询
     */
    Wrapper<PageData<BiddingProductRequest>> materielPage(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 需求对接会员列表分页查询
     */
    Wrapper<PageData<BiddingMemberResponse>> memberPage(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 报价明细
     */
    Wrapper<PageData<OnlineProductResponse>> quotedPriceDetaild(OnlineDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价单查询-作废
     */
    Wrapper<Void> discard(DiscardRequest request, UserLoginCacheDTO sysUser);

    /**
     * 待新增采购竞价单
     */
    Wrapper<PageData<BiddingListResponse>> awaitNewList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 添加采购竞价单
     */
    Wrapper<Void> add(BiddingAddRequest request, UserLoginCacheDTO sysUser, ModelMapper modelMapper);

    /**
     * 添加采购竞价单
     */
    Wrapper<Void> update(BiddingUpdateRequest request, UserLoginCacheDTO sysUser, ModelMapper modelMapper);

    /**
     * 删除采购竞价单
     */
    Wrapper<Void> delete(BaseRequest request, UserLoginCacheDTO sysUser);

    /**
     * 批量删除采购竞价单
     */
    Wrapper<Void> deleteBatch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 提交待审核采购竞价单
     */
    Wrapper<Void> biddingExamine(BaseRequest request, UserLoginCacheDTO sysUser);

    /**
     * 批量提交待审核采购竞价单
     */
    Wrapper<Void> biddingExamineBatch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-待审核采购竞价单(一级)
     */
    Wrapper<PageData<BiddingListResponse>> biddingStayExamineList1(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-审核采购竞价单(一级)
     */
    Wrapper<Void> biddingExamine1(BaseExamineRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-审核采购竞价单(一级)批量
     */
    Wrapper<Void> biddingExamine1Batch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-待审核采购竞价单(二级)
     */
    Wrapper<PageData<BiddingListResponse>> biddingStayExamineList2(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-审核采购竞价单(二级)
     */
    Wrapper<Void> biddingExamine2(BaseExamineRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-审核采购竞价单(二级)批量
     */
    Wrapper<Void> biddingExamine2Batch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-待提交采购竞价单
     */
    Wrapper<PageData<BiddingListResponse>> biddingStaySubmitList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-提交采购竞价单
     */
    Wrapper<Void> biddingSubmit(BaseExamineRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购竞价-批量提交采购竞价单
     */
    Wrapper<Void> biddingSubmitBatch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 待审核竞价报名
     */
    Wrapper<PageData<OnlineBiddingListResponse>> stayExaminBiddingList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 审核竞价报名
     */
    Wrapper<Void> stayExaminBiddingSignup(BiddingAudteRequest request, UserLoginCacheDTO sysUser);

    /**
     * 待竞价
     */
    Wrapper<PageData<BiddingListResponse>> stayBiddingList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 竞价管理
     */
    Wrapper<ManageBiddingResponse> manageBidding(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 竞价动态-竞价管理
     */
    Wrapper<BiddingDynamicResponse> dynamicBidding(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 竞价排名-竞价管理
     */
    Wrapper<List<QuotationRankingResponse>> rankingBidding(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 报名会员-竞价管理
     */
    Wrapper<List<SginUpInfoResponse>> signupMember(BaseDetailsRequest request,UserLoginCacheDTO sysUser);

    /**
     * 竞价物料&报价台-竞价管理
     */
    Wrapper<List<AwardProcessResponse>> biddingMateriel(BaseDetailsRequest request,UserLoginCacheDTO sysUser);

    /**
     * 获取采购竞价单内部流程
     */
    Wrapper<List<BiddingExternalWorkStateEnumResponse>> interiorStatus();

    /**
     * 获取采购竞价单外部部流程状态
     */
    Wrapper<List<BiddingExternalWorkStateEnumResponse>> externalStatus();

    /**
     * 待提交审核竞价结果
     */
    Wrapper<PageData<StaySubmitBiddingListResponse>> staySubmitBiddingList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 提交审核竞价结果详情
     */
    Wrapper<StaySubmitDetailsResponse> staySubmitDetails(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 提交审核竞价结果
     */
    Wrapper<Void> submitExamineBiddingReturn(SubmitExamineBiddingReturnRequest request, UserLoginCacheDTO sysUser);

    /**
     * 修改审核竞价结果
     */
    Wrapper<Void> updateBiddingReturn(SubmitExamineBiddingReturnRequest request, UserLoginCacheDTO sysUser);

    /**
     * 待审核竞价结果（一级）
     */
    Wrapper<PageData<StaySubmitBiddingListResponse>> staySubmitBiddingList1(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     *审核竞价结果（一级）
     */
    Wrapper<Void> staySubmitBidding(BaseExamineRequest request,UserLoginCacheDTO sysUser);

    /**
     *审核竞价结果（一级）批量
     */
    Wrapper<Void> staySubmitBidding1Batch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 待审核竞价结果（二级）
     */
    Wrapper<PageData<StaySubmitBiddingListResponse>> staySubmitBiddingList2(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     *审核竞价结果（二级）
     */
    Wrapper<Void> staySubmitBidding2(BaseExamineRequest request,UserLoginCacheDTO sysUser);

    /**
     *审核竞价结果（二级）批量
     */
     Wrapper<Void> staySubmitBidding2Batch(BaseAllRequest request, UserLoginCacheDTO sysUser);

    /**
     * 待确认竞价结果
     */
    Wrapper<PageData<StaySubmitBiddingListResponse>> stayConfirmBiddingList(BiddingListRequest request, UserLoginCacheDTO sysUser);

    /**
     * 确认竞价结果
     */
    Wrapper<Void> stayConfirmBidding(BaseExamineRequest request,UserLoginCacheDTO sysUser);

    /**
     *报名结束
     */
    void examine(OrderRbbitMqRequest request, Message message, Channel channel) throws IOException;

    /**
     *结束竞价
     */
     void examineSignUpEnd(OrderRbbitMqRequest request, Message message, Channel channel) throws IOException;

    /**
     * 采购商机筛选-竞价单查询
     */
    Wrapper<PageData<PurchaseListResponse>> businessPpportunityBiddingList( PurchaseListRequest request);

    /**
     * 采购公示
     */
    Wrapper<PageData<PurchaseMakeList>> purchaseMakeList(PurchaseMakeListRequest request);

    /**
     *商城能力--企业直采--采购门户--采购寻源筛选-接口
     */
    Wrapper<PageData<SearchReSourceListResponse>> searchReSourceList(PurchaseListRequest purchaseListRequest, Long shopId, UserLoginCacheDTO sysUser);

    /**
     *采购寻源--采购竞价--采购竞价详情
     */
    Wrapper<BiddingDetailsResponse> searchReSourceDetails(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     *采购物料分页查询-采购寻源--采购竞价--采购竞价详情
     */
    Wrapper<PageData<BiddingProductRequest>>  searchSourceMaterielPage( BaseDetailsRequest request);

    /**
     *分页查询在线竞标-中标的采购物料
     */
    PageData<OnLineBiddingProduct> prizeMaterielPage(PageVO pageVO, Long id);

    /**
     * 待新增商城采购竞价单
     * @param request 查询请求参数
     * @param sysUser 用户
     * @return 待新增商城采购竞价单分页列表
     */
    Wrapper<PageData<BiddingListResponse>> awaitShopNewList(BiddingListRequest request, UserLoginCacheDTO sysUser);
}
